﻿// Original author contact info: Owen Emlen (owene_1998@yahoo.com)
// Note: other individuals may also have contributed to this code
// Project hosted on CodePlex.com as of 1/10/2009 at http://wpfimageviewer.codeplex.com
using System.Collections.Generic;
using System.Threading;
using BrainTechLLC;
using BrainTechLLC.ThreadSafeObjects;
using System;

namespace BrainTechLLC
{
    public class PreloadEntry<T> where T : class
    {        
        public ICanBePreloaded<T> _item;
        public int _generation;

        public PreloadEntry(ICanBePreloaded<T> item, int generation)
        {
            _item = item;            
            _generation = generation;
        }

        public void Preload()
        {
            if (_item != null)
            {
                _item.Preload(_item);
            }
        }

        public bool IsAlreadyLoaded()
        {
            if (_item != null)
            {
                return _item.IsAlreadyLoaded(_item);
            }
            return true;
        }
    }
}
